<?php
namespace App\Providers;

use SwoStar\Routes\RouteServerProvider as ServerProvider;

class RouteServerProvider extends ServerProvider
{

    public function boot()
    {
        $this->mapRouteHttp();

        //路由服务提供者，绑定路由的加载与解析
        parent::boot();
    }

    /**
     * http服务的工作路径配置
     */
    public function mapRouteHttp()
    {
        $this->map['http'] = [
            //工作命名空间
            'namespace' => 'App\Http\Controller',
            //路由文件
            'path' => $this->app->getBasePath()."/route/http.php",
            //标签
            'flag' => 'http'
        ];
    }

    /**
     * websocket服务的工作路径配置
     */
    public function mapRouteWS()
    {
        $this->map['websocket'] = [
            'namespace' => 'App\WebSocket\Controller',
            'path' => $this->app->getBasePath()."/route/websocket.php",
            'flag' => 'websocket'
        ];
    }
}
